package com.spring.starter;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

import java.util.List;

public interface CompactDisc {
    void say(String str);
}
@Primary
class SgtPeppers implements CompactDisc {
    @Override
    public void say(String str) {
        System.out.println("SgtPeppers: " + str);
    }
}
@Qualifier("sgtPeppers1")
class BlankDisc implements CompactDisc {
    private String title;
    private String artist;
    private List<String> tracks;

    public List<String> getTracks() {
        return tracks;
    }

    public void setTracks(List<String> tracks) {
        this.tracks = tracks;
    }

    public BlankDisc() {
    }

    public BlankDisc(@Value("disc.title") String title, @Value("disc.artist") String artist) {

        this.title = title;
        this.artist = artist;
    }

    public void setTitle(@Value("#{systemProperties[disc.title]}") String title) {
        this.title = title;
    }

    public void setArtist(@Value("#{systemProperties[disc.artist]}") String artist) {
        this.artist = artist;
    }

    @Override
    public void say(String str) {
        System.out.println("BlankDisc: " + str);
    }

    public static String charStr(){
        return "sss char";
    }
}

class WhiteAlbum implements CompactDisc {
    private String color;
    public String title;
    private String name;
    private List<String> songs;
    private Integer num;

    public void setNum(Integer num) {
        this.num = num;
    }

    public WhiteAlbum() {
    }

    public WhiteAlbum(String title, String name, List songs) {
        this.title = title;
        this.name = name;
        this.songs = songs;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public void say(String str) {
        System.out.println("whiteAlbum: " + str);
    }
}

class Resolver implements CompactDisc {
    @Override
    public void say(String str) {
        System.out.println("Resolver: " + str);
    }
}